{
  "nbformat": 4,
  "nbformat_minor": 0,
  "metadata": {
    "colab": {
      "provenance": [],
      "gpuType": "T4"
    },
    "kernelspec": {
      "name": "python3",
      "display_name": "Python 3"
    },
    "language_info": {
      "name": "python"
    },
    "accelerator": "GPU"
  },
  "cells": [
    {
      "cell_type": "code",
      "execution_count": null,
      "metadata": {
        "id": "mwXUcr7wBZbj"
      },
      "outputs": [],
      "source": [
        "!pip install huggingface_hub transformers[agents]"
      ]
    },
    {
      "cell_type": "code",
      "source": [
        "from huggingface_hub import login\n",
        "\n",
        "login(\"<INSERT_TOKEN_HERE>\")"
      ],
      "metadata": {
        "id": "z48Rgtz6IcAF"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "from transformers import HfAgent\n",
        "\n",
        "agent = HfAgent(\"https://api-inference.huggingface.co/models/bigcode/starcoderbase\")"
      ],
      "metadata": {
        "id": "VMppsQluJG7b"
      },
      "execution_count": null,
      "outputs": []
    },
    {
      "cell_type": "code",
      "source": [
        "agent.run(\"Draw me a picture of `prompt`\", prompt=\"rainbow butterflies\")"
      ],
      "metadata": {
        "id": "4BuzW4cHORYR"
      },
      "execution_count": null,
      "outputs": []
    }
  ]
}